package com.tanhua.manager.controller;

import com.tanhua.manager.service.AnalysisByDayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("/dashboard")
public class DashboardController {

    @Autowired
    private AnalysisByDayService analysisByDayService;

    @GetMapping(value = "/summary",name = "汇总首页数据-概要统计信息")
    public ResponseEntity summary(){
       return analysisByDayService.summary();
    }

    //GET/dashboard/users
    @GetMapping(value = "/users", name = "新增、活跃用户、次日留存率")
    public ResponseEntity users(Long sd, Long ed, Integer type) {
        return analysisByDayService.users(sd,ed,type);
    }

}
